continue_hypercall_on_cpu() always defers execution of the continuation
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 15 Apr 2010 10:31:58 +0000 (11:31 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 15 Apr 2010 10:31:58 +0000 (11:31 +0100)
...even when scheduled to run on the current physical cpu. This
ensures that locks get dropped correctly before executing the
continuation code, and also allows the original caller to determine
whether the continuation has/will execute based on c_h_o_c()'s
immediate return code.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/common/domain.c
xen/include/xen/domain.h

index 6707b332464b1c1026e475eef3472b10d57bce4d..086f64ab4fe0e7447a297da3e3aabc7decd7833e 100644 (file)
@@ -951,9 +951,6 @@ int continue_hypercall_on_cpu(
     if ( (cpu >= NR_CPUS) || !cpu_online(cpu) )
         return -EINVAL;
 
-    if ( cpu == smp_processor_id() )
-        return func(data);
-
     info = this_cpu(continue_info);
     if ( info == NULL )
     {
index 79711bdb29e97d0e3991a45d666aee9154287d8a..0b62c22afee703a13d04fb3931346b61eb869ad7 100644 (file)
@@ -63,7 +63,12 @@ void arch_vcpu_reset(struct vcpu *v);
 bool_t domctl_lock_acquire(void);
 void domctl_lock_release(void);
 
-/* Continue the current hypercall via func(data) on specified cpu. */
+/*
+ * Continue the current hypercall via func(data) on specified cpu.
+ * If this function returns 0 then the function is guaranteed to run at some
+ * point in the future. If this function returns an error code then the
+ * function has not been and will not be executed.
+ */
 int continue_hypercall_on_cpu(
     unsigned int cpu, long (*func)(void *data), void *data);